package com.zp.base;

//将枚举作为方法参数：
public class EnumTest {
	public static void operator(OpConstance o){
		switch(o){
			case TURN_RIGHT : System.out.println("向右转");break;
			case TURN_LEFT : System.out.println("向左转");break;
			case SHOOT : System.out.println("射击");break;
		}
	}
	
	public static void main(String[] args) {
		EnumTest.operator(OpConstance.SHOOT);
	}
}

enum OpConstance{
	TURN_RIGHT,TURN_LEFT,SHOOT
}